package com.epam.kozich.manager;

import java.util.ArrayList;

import org.springframework.transaction.annotation.Transactional;

import com.epam.kozich.model.Book;
import com.epam.kozich.model.Order;
import com.epam.kozich.model.Person;

public class OrderManager {
	Order order;
	private ArrayList<Order> listOrders = new ArrayList<Order>();
	public ArrayList<Order> getListOrders() {
		return listOrders;
	}

	public void addOrderInList(Order order) {
		this.listOrders.add(order);
	}
	@Transactional
	public void addOrder(Book book, Person person) {
		order = new Order();
		//order.getBook();
		order.getPerson();
		if (book.isEmpty()&&person.isBanned())
			getListOrders().add(order);
			
	}
}
